package com.hbpu.encap.homework02;

public class Homework {
    public static void main(String[] args) {
        System.out.println(Forck.getNextNum());
        System.out.println(Forck.getNextNum());

        Forck forck = new Forck();
        System.out.println(forck.getSerialNumber());
        Forck forck1 = new Forck();
        System.out.println(forck1.getSerialNumber());
        Forck forck2 = new Forck();
        System.out.println(forck2.getSerialNumber());
    }
}

class Forck {
    private static int currentNum = 100000;
    private int serialNumber;

    public Forck() {
        this.serialNumber = getNextNum();
    }

    public static int getNextNum() {
        return currentNum += 100;
    }

    public int getSerialNumber() {
        return serialNumber;
    }
}
